package com.xucan.fanxingx;

import java.util.List;

public class ListUtil {
    public static <T> void printList(List<T> list, T t){
        for (T te : list) {
            System.out.println(te);
        }
    }

    public static void main(String[] args) {
        List<String> list = null;
        ListUtil.printList(list, "a");//这里的t元素只能为a类型
    }
}
